﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using RomatimeFrontend.ServiceReference1;
using RomatimeFrontend.Models;

namespace RomatimeFrontend.Controllers
{
    public class ListProjectsController : Controller
    {

        Service1Client db = new Service1Client();
        //
        // GET: /ListProjects/

        public ActionResult Index()
        {

            UserUI user = (UserUI) Session["user"];
            List<ProjectUI> projects = db.getProjectsWithUserInRole(2,user.id).ToList();

            return View(projects);
        }

        [HttpGet]
        public ActionResult Create()
        {
            ProjectWrapper ufp = new ProjectWrapper(); ;

            ufp.users = db.getUsers().ToList();
            return View(ufp);
        }

    }
}
